#!/bin/bash
# 快速修复 - 复制 QtDBus 框架
set -e

APP="/Applications/LimeReader.app"
FRAMEWORKS="$APP/Contents/Frameworks"

echo "复制 QtDBus 框架..."

# 复制 QtDBus
cp -R /opt/homebrew/opt/qt/lib/QtDBus.framework "$FRAMEWORKS/"

# 签名
codesign -f -s - "$FRAMEWORKS/QtDBus.framework" 2>/dev/null || true

# 重新签名应用
codesign -f -s - --deep "$APP" 2>/dev/null || true

echo "✅ 完成！现在运行: open /Applications/LimeReader.app"

